<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
	 <%@include file="include.jsp" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>文件上传</title>

</head>
<body>

	<script type="text/javascript">

		$(document).ready(function() {
			$("p").click(function() {
				//$(this).hide();
				alert($("#share1").prop("checked"));
			});
			$("#button1").click(function() {
				$.get("testjson.action", function(result, status) {
					alert("Data: " + result + "\nStatus: " + status);
				});
			});
			
			

    	$.get("listLibrary.action",function(data){
    		for(var i=0;i<data.data.length;i++)
    		$("#selectLib").append("<option value='"+data.data[i].libraryid+"'>"+data.data[i].libraryname+"</option>");
    	});
		//$("#getlib").click(function(){
			$.get("fileclass.action", function(c, status) {
				
				for(var i=0;i<c.fileclass.fileclass.length;i++)
				$("#selectFileClass").append("<option value='"+c.fileclass.fileclass[i].classid+"'>"+c.fileclass.fileclass[i].classname+"</option>");
				
			});
		//});
		
				
			
			
			
			/*if($("#share").val()==1){
				$("#share").val(0);
			}else if(("#share").val()==0){
				$("#share").val(1);
			}*/
			/*
			$("#share").change(function(){
				if($("#share").prop("checked")==true){
				$("#share").val(1);
				alert("select");
			}else{
				$("#share").val(0);
			}
				});
			
			 */
			$("input.cv").val(0);
			// $("input.c").each(function(){	});
				
			 $("input.c").prop("checked",false);
			
			$("#shareFlag").change(function() {					
					if ($(this).prop("checked") == true) {						
						$("#share").val(1);						
					} else {
						$("#share").val(0);
						
					}

				});
			$("#downloadFlag").change(function() {					
				if ($(this).prop("checked") == true) {						
					$("#download").val(1);						
				} else {
					$("#download").val(0);
					
				}

			});

		});
	</script>
	
	
	    <script>




        $(function(){
            var form = $(".login-form");

            form.css({
                opacity: 1,
                "-webkit-transform": "scale(1)",
                "transform": "scale(1)",
                "-webkit-transition": ".5s",
                "transition": ".5s"
            });
        });
    </script>
	<h1>文件上传</h1>

<div class="login-form padding20 block-shadow" style="text-align:center;">

	<form action="uploadFile.action" method="post"
		enctype="multipart/form-data">
		<div class="input-control file" data-role="input">
			<input type="file" tabindex="-1" style="z-index: 0;" name="file"/> 
			
				<button class="button" type="button">
				<span class="mif-folder"></span>
			</button>
			
		</div>
		<br/>
		<label class="input-control checkbox"> 
					<input type="checkbox"  class="c"  id="shareFlag"  >
					<input type="hidden" class="cv" name="upload_file.share" id="share" >
					<span class="check"></span> 
					<span class="caption">是否共享给他人查看</span>
				</label>
		
		<br/>
		
		<input type="hidden"  name="upload_file.userid" id="userid" value="${userid}">
				<!--  <input type="hidden"  name="upload_file.userid" id="userid" value="${username}">-->
		<label class="input-control checkbox"> 
					<input type="checkbox" class="c"  id="downloadFlag" >
					<input type="hidden" class="cv" name="upload_file.download" id="download" >
					<span class="check"></span> 
					<span class="caption">是否允许他人下载</span>
				</label>
		
		<br/>
		<div class="input-control select">		
		<select id="selectFileClass" name="upload_file.classid">
		
		</select>
		</div>
		<br/>
		<div class="input-control select">
		<select id="selectLib" name="upload_file.libraryid">
		
		</select>
		</div>
		<br/>		
		<button class="button success block-shadow-success" type="submit" onclick="">上传</button>
	</form>
</div>


</body>
</html>